import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const state = {
    name: "",
    version: ""
}
/**
 * mutations 里面放置的是我们操作state对象属性的方法
 */
const mutations = {
    link(state, setting) {
        state.name = setting.name;
        state.version = setting.version;
    }
}
const actions = {
    link(state, href) {
        state.href = href;
    }
}
const getters = {
    getHref(state) {
        return (state.href)
    }
}
export default new Vuex.Store({
    state,
    mutations,
    actions,
    getters
})